define(function (require) {
var zsApp= require('app');  
require('selectCache');
require('roleby');
require('rolebyrole');
require('rolebyuser');
zsApp.controller('gameController', ['$scope', '$http', '$timeout', 'selectCache', function($scope, $http, $timeout, selectCache) {
	// pagination
	$scope.paginationConf = {
        currentPage     : 1,
        totalItems      : 100,
        itemsPerPage    : 10,
        pagesLength     : 15,
        perPageOptions  : [10, 20, 30, 40, 50],
        onChange: function() { 
        	var self = this,
	        	pagingData = {
	        		pageNumber  : self.currentPage,  
					pageSize 	: self.itemsPerPage,  
	        	};	
			$http
			({
				url  	: $scope.zsUrl+'digitalhome-boss/product/resouceType/getList',
				method 	: 'POST',
				data 	:  {
                    pageNumber  : self.currentPage,  
                    pageSize    : self.itemsPerPage,  
                }

			}).success(function(res) { 
				console.log(res);
                if( 0 == res.length ) { 
                    return false;
                }
                // 系统配置键列表页面表格
                $scope.tabVal = res.result;
                angular.forEach($scope.tabVal, function(obj, i) {
                    // 遍历每条数据对应的ID
                    $scope.dataID[i]   = obj.resTypeId;
                });
                // 总共有多少条数据
                self.totalItems = res.length;
            }).error(function(err) {
            	
            });
        }
    };
}])    
});